package com.qd.panda.service.applyfor;

import java.util.List;

/**
 * 〈一句话功能简述〉<br>
 *
 * @author sjk
 * @create 2023-08-07 10:48
 * @since 1.0.0
 */
public class StateUtil {
    private StateUtil(){

    }
    /**
     * 状态:0处理中
     */
    public static final int STATE_0 = 0;
    /**
     * 状态:1处理成功
     */
    public static final int STATE_1 = 1;
    /**
     * 状态:2处理失败
     */
    public static final int STATE_2 = 2;

    private static final List<Integer> STATE_LIST = List.of(STATE_0, STATE_1, STATE_2);

    public static boolean isNotExists(int state) {
        return !STATE_LIST.contains(state);
    }

    public static String idToDisplay(int state) {
        String display = "";
        if (state == STATE_0) {
            display = "处理中";
        }
        if (state == STATE_1) {
            display = "处理成功";
        }
        if (state == STATE_2) {
            display = "处理失败";
        }
        return display;
    }
}